home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2004 June
/
PCWorld_2004-06_cd.bin
/
software
/
vyzkuste
/
koolmoves
/
kmsetup.exe
/
{app}
/
Motion Scripts
/
Bar Write On
/
effect2.txt
Wrap
Text File
|
2004-03-29
|
2KB
|
75 lines
// main_init function
main_init = function(mc){
box = function ( mc, tl_x, tl_y, br_x, br_y ){
mc.lineStyle();
mc.beginFill(0);
mc.moveTo (tl_x,tl_y);
mc.lineTo (br_x,tl_y);
mc.lineTo (br_x,br_y);
mc.lineTo (tl_x,br_y);
mc.endFill();
}
sw_box = function ( mc, tl_x, tl_y, br_x, br_y, cf ){
mc.lineStyle();
var colors = [cf,cf];
var alphas = [100,0];
var ratios = [192,255];
var matrix = { matrixType:"box", r:0 };
matrix.x = tl_x;
matrix.y = tl_y;
matrix.w = br_x-tl_x;
matrix.h = br_y-tl_y;
mc.beginGradientFill( "radial", colors, alphas, ratios, matrix );
mc.moveTo (tl_x,tl_y);
mc.lineTo (br_x,tl_y);
mc.lineTo (br_x,br_y);
mc.lineTo (tl_x,br_y);
mc.endFill();
}
subs_done = true;
createEmptyMovieClip("msk",6);
createEmptyMovieClip("sw",7);
b = mc.getBounds(mc);
p = $padding / 2;
if ((out_effect && !rtol) || (rtol && !out_effect)){
box(msk,0,b.yMin,mc._width+10,b.yMax);
}else{
box(msk,-mc._width-10,b.yMin,0,b.yMax);
}
mc.setMask(msk);
sw_box(sw,-2,b.yMin+p-30,2,b.yMax-p+30,sw_color);
msk._x = sw._x = rtol ? b.xMax-p+5 : b.xMin+p-5;
sw._alpha = sw.alpha = 0;
}
// main_effect function
main_effect = function(mc,frame){
if (sw._alpha<100 && (rtol ? sw._x > 0 : sw._x < 0)){
sw._yscale = sw._alpha = sw.alpha += 20;
} else {
msk._x = sw._x+= rtol ? -sw_speed : sw_speed;
if (sw._x >= b.xMax-p+5 || sw._x <= b.xMin+p-5){
msk._x = sw._x = rtol ? b.xMin+p-5 : b.xMax-p+5;
sw._alpha = sw.alpha -=20;
if (sw._alpha<=0){
sw.removeMovieClip();
msk.removeMovieClip();
if (out_effect) mc._alpha = 0;
end_effect=true;
}
}
}
}
// sub_init function
sub_init = function(mc){
}
// sub_effect function
sub_effect = function(mc,frame){
}